package com.ruowei.modules.foodOrder.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class AppletMerchandiseDTO {
    @ApiModelProperty(value = "商品名称")
    private String name;

    @ApiModelProperty(value = "商品编码")
    private String merchandiseCode;

    @ApiModelProperty(value = "图片")
    private String photos;

    @ApiModelProperty(value = "简介")
    private String description;

    @ApiModelProperty(value = "月售")
    private Long monthlySale;

    @ApiModelProperty(value = "价格")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "是否新品")
    private Boolean newStatus;

    @ApiModelProperty(value = "是否参与满减")
    private Boolean participateFullDiscount;

    @ApiModelProperty(value = "是否推荐")
    private Boolean recommendStatus;

    @ApiModelProperty(value = "总销量")
    private Long totalSale;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "以逗号分割的产品服务：1->无忧退货；2->快速退款；3->免费包邮")
    private String serviceIds;

    @ApiModelProperty(value = "评分")
    private BigDecimal score;

    @ApiModelProperty(value = "好评度带%")
    private String praiseProportion;

    @ApiModelProperty(value = "是否有规格")
    private Boolean hasSpecification;

    @ApiModelProperty(value = "默认规格编码")
    private String defaultSkuCode;

    @ApiModelProperty(value = "自定义的商品参数，key-value")
    private List<MerchandiseParameter> parameters;

    public AppletMerchandiseDTO(String name, String merchandiseCode, String photos,
                                String description, Long monthlySale, BigDecimal unitPrice,
                                Boolean newStatus, Boolean participateFullDiscount,
                                Boolean recommendStatus, Long totalSale, String unit,
                                String serviceIds, BigDecimal score, String praiseProportion,
                                List<MerchandiseParameter> parameters, Boolean hasSpecification,
                                String defaultSkuCode) {
        this.name = name;
        this.merchandiseCode = merchandiseCode;
        this.photos = photos;
        this.description = description;
        this.monthlySale = monthlySale;
        this.unitPrice = unitPrice;
        this.newStatus = newStatus;
        this.participateFullDiscount = participateFullDiscount;
        this.recommendStatus = recommendStatus;
        this.totalSale = totalSale;
        this.unit = unit;
        this.serviceIds = serviceIds;
        this.score = score;
        this.praiseProportion = praiseProportion;
        this.parameters = parameters;
        this.hasSpecification = hasSpecification;
        this.defaultSkuCode = defaultSkuCode;
    }

    @Data
    public static class MerchandiseParameter {
        @ApiModelProperty(value = "参数名")
        private String key;

        @ApiModelProperty(value = "参数值")
        private String value;
    }
}
